package com.baizhi.video.controller;


import com.baizhi.video.service.IVideoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * <p>
 * 视频 前端控制器
 * </p>
 *
 * @author gange
 * @since 2023-07-18
 */
@RestController
@RequestMapping("/video")
public class VideoController {
    @Autowired
    private IVideoService videoService;
    @GetMapping("/videos")
    public Map<String,Object> selectVideo(
            @RequestParam(value = "page",defaultValue = "1",required = false) Integer page,
            @RequestParam(value = "per_page",defaultValue = "5",required = false) Integer per_page,
            Integer id,
            String name,
            Integer category_id,
            String uploader_name
    ){
        return videoService.selectVideo(page,per_page,id,name,category_id,uploader_name);
    }
}

